<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <title>阈值管理</title>
    <meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no'
          name='viewport'/>
    <link rel="stylesheet" href="/assets/css/bootstrap.min.css">
    <link rel="stylesheet"
          href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i">
    <link rel="stylesheet" href="/assets/css/ready.css">
    <link rel="stylesheet" href="/assets/css/demo.css">
    <link rel="stylesheet" href="/assets/css/mystyle.css">
</head>
<body>
<div class="wrapper">
    <div th:replace="~{index::topbar}"></div>
    <div th:replace="~{index::sidebar(activeUri='/setting/threshold')}"></div>
    <div class="main-panel">
        <div class="content">
            <div class="container-fluid">
                <h4 class="page-title">阈值设置</h4>
                <div class="row">
                    <div class="col-md-12">
                        <div class="card">
                            <div class="card-body">
                                <div class="row">
                                    <div class="col-md-4">
                                        <div class="input-group">
                                            <input type="text" placeholder="Search ..." class="form-control" id="SearchContent">
                                            <div class="input-group-append">
											<span class="input-group-text">
												<i class="la la-search search-icon"></i>
											</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                <input class="btn btn-block btn-round" value="搜索" type="button" id="searchThresholdButton">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-4"></div>
                                    <div class="col-md-4">
                                        <button class="btn btn-primary pull-right" data-toggle="modal" data-target="#AddSetting">添加新阈值</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <div class="card">
                            <div class="card-header">
                                <div class="card-title text-center">列表</div>
                            </div>
                            <div class="card-body">
                                <table class="table table-hover">
                                    <thead>
                                    <tr>
                                        <th scope="col" class="text-md-center">ID</th>
                                        <th scope="col" class="text-md-center">桥名称</th>
                                        <th scope="col" class="text-md-center">传感器名称</th>
                                        <th scope="col" class="text-md-center">阈值名称</th>
                                        <th scope="col" class="text-md-center">一级阈值</th>
                                        <th scope="col" class="text-md-center">二级阈值</th>
                                        <th scope="col" class="text-md-center">类型</th>
                                        <th scope="col" class="text-md-center">操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr th:each="threshold,thresholdStat:${t_lists}">
                                        <td class="text-md-center" th:text="${threshold[0]}"><p>5</p></td>
                                        <td class="text-md-center" th:text="${threshold[10]}"><p>1</p></td>
                                        <td class="text-md-center" th:text="${threshold[8]}"><p>dragon</p></td>
                                        <td class="text-md-center" th:text="${threshold[6]}"><p>长江大桥</p></td>
                                        <td class="text-md-center" th:text="${threshold[3]}"><p>5</p></td>
                                        <td class="text-md-center" th:text="${threshold[4]}"><p>5</p></td>
                                        <td class="text-md-center" th:text="${threshold[9]}"><p>5</p></td>
                                        <td class="text-md-center">
                                            <a class="badge badge-warning" href="" data-toggle="modal" data-target="#Setting">设置</a>
                                            <a class="badge badge-danger" href="" data-toggle="modal" th:id="thre+${threshold[0]}">删除</a>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div th:replace="~{index::footer}"></div>
    </div>
</div>
</div>
<!-- deleteModal -->
<div class="modal fade" id="deleteSetting" tabindex="-1" role="dialog" aria-labelledby="modalUpdatePro"
     aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered" role="document">
        <div class="modal-content">
            <div class="modal-header bg-primary">
                <h6 class="modal-title"><i class="la la-frown-o"></i>删除预警</h6>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body text-center">
                <p>是否删除此阈值</p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" data-dismiss="modal" id="confirmDeleteTreshold">确定</button>
            </div>
        </div>
    </div>
</div>
<!--AddSettingModal-->
<div class="modal fade" id="AddSetting" tabindex="-1" role="dialog" aria-labelledby="modalUpdatePro"
     aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered" role="document">
        <div class="modal-content">
            <div class="modal-header bg-primary">
                <h6 class="modal-title"><i class="la la-frown-o"></i> 增加阈值</h6>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body text-center">
                <form action="" method="post" id="addThresholdForm">
                    <div class="form-group">
                        请选择地区：
                        <select class="form-control" id="InputDomain1" >
                            <option value="-1">请选择地区</option>
                            <option th:each="Domain,iterStat:${d_lists}" th:value="${Domain.DomainID}" th:text="${Domain.DomainName}">洪山区</option>
                        </select>
                    </div>
                    <div class="form-group">
                        请选择桥梁：
                        <select class="form-control" id="InputBridge1" name="BID">
                            <option value="-1">请选择桥梁</option>
                        </select>
                    </div>
                    <div class="form-group">
                        请选择传感器：
                        <select class="form-control" id="InputSensor1" name="SensorID">
                            <option value="-1">请选择传感器</option>
                        </select>
                    </div>
                    <div class="form-group">
                        阈值名称：<input type="text" class="form-control" id="InputThreshold1" placeholder="阈值名称" name="ThresholdName">
                    </div>
                    <div class="form-group">
                        一级阈值：<input type="text" class="form-control" id="InputFirstThreshold1" placeholder="0" name="FirstThreshold">
                    </div>
                    <div class="form-group">
                        二级阈值：<input type="text" class="form-control" id="InputSecondThreshold1" placeholder="0" name="SecondThreshold">
                    </div>
                    <input type="hidden" name="UID" value="0">
                    <input type="hidden" name="CreatTime" th:value="${current}">
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" id="submitThreshold">提交</button>
            </div>
        </div>
    </div>
</div>
</body>
<script src="/assets/js/core/jquery.3.2.1.min.js"></script>
<script src="/assets/js/plugin/jquery-ui-1.12.1.custom/jquery-ui.min.js"></script>
<script src="/assets/js/core/popper.min.js"></script>
<script src="/assets/js/core/bootstrap.min.js"></script>
<script src="/assets/js/plugin/chartist/chartist.min.js"></script>
<script src="/assets/js/plugin/chartist/plugin/chartist-plugin-tooltip.min.js"></script>
<script src="/assets/js/plugin/bootstrap-notify/bootstrap-notify.min.js"></script>
<script src="/assets/js/plugin/bootstrap-toggle/bootstrap-toggle.min.js"></script>
<script src="/assets/js/plugin/jquery-mapael/jquery.mapael.min.js"></script>
<script src="/assets/js/plugin/jquery-mapael/maps/world_countries.min.js"></script>
<script src="/assets/js/plugin/chart-circle/circles.min.js"></script>
<script src="/assets/js/plugin/jquery-scrollbar/jquery.scrollbar.min.js"></script>
<script src="/assets/js/ready.min.js"></script>
<script src="/assets/js/Threshold.js"></script>
</html>